Skip to content

Feat: HTML verification report - #529

Merged
rholshausen merged 9 commits into
masterfrom
html-verification-report
Apr 30, 2026
Merged

Feat: HTML verification report#529
rholshausen merged 9 commits into
masterfrom
html-verification-report

Conversation

@rholshausen

Copy link
Copy Markdown
Contributor

Adds an --html option to the verifier CLI to render an HTML report of the verification.

Sample report:
image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds HTML report generation to pact_verifier_cli by introducing a new --html <html-file> CLI option and implementing an XML→XSLT→HTML rendering pipeline for verification results.

Changes:

  • Add --html / PACT_VERIFIER_HTML_REPORT CLI option and wire it into verification handling.
  • Introduce XML report serialization (via quick-xml + serde) and an embedded XSLT stylesheet to render the HTML report.
  • Add snapshot tests for the XML report and update CLI help output fixture.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
rust/pact_verifier_cli/tests/cmd/main.stderr Updates CLI help snapshot to include the new --html flag.
rust/pact_verifier_cli/src/args.rs Adds the --html CLI argument and env var support.
rust/pact_verifier_cli/src/lib.rs Calls HTML report writer when --html is provided; adds/updates some public functions/docs.
rust/pact_verifier_cli/src/reports/mod.rs Implements HTML report writing by generating XML and applying embedded XSLT via xrust.
rust/pact_verifier_cli/src/reports/xml.rs New XML DTO + serializer for verification results, with snapshot tests.
rust/pact_verifier_cli/src/reports/verification-report.xsl New XSLT stylesheet defining the HTML report layout/style.
rust/pact_verifier_cli/src/reports/snapshots/*.snap Adds insta snapshots for XML serialization tests.
rust/pact_verifier_cli/Cargo.toml Adds dependencies for XML serialization, XSLT transform, and snapshots.
rust/Cargo.lock Lockfile updates for new dependencies.
Comments suppressed due to low confidence (2)

rust/pact_verifier_cli/src/reports/mod.rs:116

  • path.parent() can be an empty path when file_name is just a filename (e.g. "report.html"). Calling fs::create_dir_all with an empty path is at best unnecessary and can error on some platforms. Consider skipping directory creation when the parent is empty (treat as current directory).
    rust/pact_verifier_cli/src/reports/mod.rs:134
  • --html currently always writes an additional sidecar XML file next to the HTML output (same basename, .xml). This is a user-visible side effect that can overwrite an existing file and isn’t implied by the flag name/help text. Consider transforming in-memory (no XML file), or make the XML output optional / clearly documented.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rust/pact_verifier_cli/src/args.rs Outdated
Comment thread rust/pact_verifier_cli/src/lib.rs Outdated
Comment thread rust/pact_verifier_cli/src/lib.rs
Comment thread rust/pact_verifier_cli/src/lib.rs
Comment thread rust/pact_verifier_cli/tests/cmd/main.stderr Outdated
Comment thread rust/pact_verifier_cli/src/args.rs Outdated
rholshausen and others added 4 commits April 30, 2026 16:36
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mefellows

Copy link
Copy Markdown
Member

This is great! You know what would be really helpful to add - output logs in collapsable or perhaps in a separate page in a directory. This way you can isolate the logs for the scenario.

But that shouldn't stop this going out. If we wanted to future proof it, we could specify a directory for the --html option, so over time we could add multiple supporting artifacts.

@rholshausen
rholshausen merged commit 7c660d1 into master Apr 30, 2026
35 of 36 checks passed
@rholshausen
rholshausen deleted the html-verification-report branch April 30, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants